<?php

namespace App\Http\Controllers\API\Admin;

use App\Http\Requests\CreateCategoryRequest;
use App\Http\Requests\UpdateCategoryRequest;
use App\Models\Category;
use App\Repositories\CategoryRepository;
use App\Http\Controllers\AppBaseController;
use App\Repositories\PicturesRepository;
use App\Repositories\WechatRepository;
use App\ZL\Controllers\ApiBaseController;
use Illuminate\Http\Request;
use Flash;
use Illuminate\Support\Facades\Auth;
use Prettus\Repository\Criteria\RequestCriteria;
use Response;

class WechatAPIAdminController extends ApiBaseController
{
    private $wechatRepository;
    protected $model_name = 'App\Models\Wechat';
    protected $model_load_array = [
    ];

    public function __construct(WechatRepository $wechatRepository)
    {
        $this->wechatRepository = $wechatRepository;
    }

    public function getConfig()
    {
        return responseZK(1,Auth::guard('admin')->user()->shop->wechat);
    }

    public function setConfig(Request $request)
    {
        $input = $request->all();
        return responseZK(1,Auth::guard('admin')->user()->shop->wechat->update($input));
    }
}
